/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.jsimplemarket.model;

import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Alexandru.Codescu
 */
@Entity
@Table(name = "persoane")
public class Persoana extends AbstractEntitate {
    private String denumire;
    private Firma firma;
    private List<FisierAtasatPersoana> fisierAtasatCantar;

    @Column(name = "DENUMIRE", nullable = false, length = 200)
    public String getDenumire() {
        return denumire;
    }

    public void setDenumire(String denumire) {
        this.denumire = denumire;
    }

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "FIRMA_ID")
    public Firma getFirma() {
        return firma;
    }

    public void setFirma(Firma firma) {
        this.firma = firma;
    }

    @OneToMany(fetch = FetchType.LAZY)
    @JoinColumn(name = "ID_PERSOANA")
    public List<FisierAtasatPersoana> getFisierAtasatCantar() {
        return fisierAtasatCantar;
    }

    public void setFisierAtasatCantar(List<FisierAtasatPersoana> fisierAtasatCantar) {
        this.fisierAtasatCantar = fisierAtasatCantar;
    }
}
